package org.xml.xpath4js.client;

/* 
xpath4js is a GWT implementation of XPath 2.0 
Copyright (C) 2010  Peter Schonefeld (peter dot schonefeld at gmail)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

public class XPathItem {

	String stringValue = "";
	String xsdType = ""; //TODO: will eventually point to instance of XSDType	
	
	public Object DomObject = new Object(); //to map to orinal input node //GWT Compile	
	
	public XPathItem(){
		stringValue = "";
		xsdType = "xs:anySimpleType";
	}
		
	public XPathItem(String sVal, String sXSDType){
		stringValue = sVal;
		xsdType = sXSDType;			
	}

	//return the XML Schema type. Will always be of XSD type xs:string
	public String GetStringValue(){
		return stringValue;		
	}

	//return the XML Schema type
	//TODO: make this return type XSDType	
	public String GetXSDType(){
		return xsdType;		
	}
	
	//Atomic items do not have document order so return -1.	
	public Integer GetDocumentOrder(){
		return -1;
	}

	//TODO:
	public boolean IsNode(){
		return false; 
	}

	//TODO:	
	public boolean Is(XPathItem item){
		return false;
	}

	public String toString(){
		return this.stringValue;
	}

}
